// src/main/java/com/example/qqviewspringboot/repository/DynamicRepository.java

package com.example.qqviewspringboot.repository;

import com.example.qqviewspringboot.data.Dynamic;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface DynamicRepository extends JpaRepository<Dynamic, Long> {
    List<Dynamic> findByUserIdOrderByCreatedAtDesc(Long userId);
    List<Dynamic> findAllByOrderByCreatedAtDesc(); // 新增：获取所有动态，按创建时间降序
}
